<template>
    <view>
        <button type="primary" @click="scanCode()">扫一扫</button>
    </view>
</template>
<script>
    export default {
        data() {
            return {
            };
        },
        methods: {
            scanCode() {
                 // 允许从相机和相册扫码
                 uni.scanCode({
                     success: function (res) {
                         console.log('条码类型：' + res.scanType);
                         console.log('条码内容：' + res.result);
						 console.log(res);
						 uni.navigateTo({
						 	url: res.result
						 })
                     }
                 });
            }
        }
    }
</script>